package com.example.pojo;


import jakarta.validation.constraints.NotNull;
import jakarta.validation.groups.Default;

import java.time.LocalDateTime;

/**
 * @Description TODO
 * @Author fantasy
 * @Date 2024/6/26 21:55
 **/


public class Category {
    @NotNull(groups = {Update.class})
    private Integer id;
    @NotNull
    private String categoryName;
    @NotNull
    private String categoryAlias;
    private Integer createUser;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
//如果某个校验没有分组，则默认为默认分组default
//    分组直接可以继承，A extends B，则A继承B的校验规则
    public interface Add extends Default {}
    public interface Update extends Default{}

    public Category(){}
    @Override
    public String toString() {
        return "Category{" +
                "id=" + id +
                ", categoryName='" + categoryName + '\'' +
                ", categoryAlisa='" + categoryAlias + '\'' +
                ", createUser=" + createUser +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public String getCategoryAlisa() {
        return categoryAlias;
    }

    public void setCategoryAlisa(String categoryAlias) {
        this.categoryAlias = categoryAlias;
    }

    public Integer getCreateUser() {
        return createUser;
    }

    public void setCreateUser(Integer createUser) {
        this.createUser = createUser;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
}
